package co.yixiang.modules.order.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Map;

/**
 * @ClassName OrderExtendDto
 * @Author hupeng <610796224@qq.com>
 * @Date 2019/10/28
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderExtendDto implements Serializable {

    @ApiModelProperty(value = "唯一的key")
    private String key;

    @ApiModelProperty(value = "订单ID")
    private String orderId;

    @ApiModelProperty(value = "微信相关配置")
    private Map<String,String> jsConfig;

    public static OrderExtendDtoBuilder builder() {
        return new OrderExtendDtoBuilder();
    }

    public static class OrderExtendDtoBuilder {
        private String key;
        private String orderId;
        private Map<String, String> jsConfig;

        OrderExtendDtoBuilder() {
        }

        public OrderExtendDtoBuilder key(String key) {
            this.key = key;
            return this;
        }

        public OrderExtendDtoBuilder orderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public OrderExtendDtoBuilder jsConfig(Map<String, String> jsConfig) {
            this.jsConfig = jsConfig;
            return this;
        }

        public OrderExtendDto build() {
            return new OrderExtendDto(key, orderId, jsConfig);
        }

        public String toString() {
            return "OrderExtendDto.OrderExtendDtoBuilder(key=" + this.key + ", orderId=" + this.orderId + ", jsConfig=" + this.jsConfig + ")";
        }
    }
}
